import StoTableXXX from '@/components/StoTableXXX/StoTableXXX'


import { getStudents } from "@/common/mockdata";
let totalPages = 20
let currentPage = 1;
const allStudents = getStudents(totalPages);
const pageSize = 10;

const formatter = {
    avatar: (student: any) => (
        <a href={`/${student.id}`}>
            <img src={student.avatar} alt="" />
        </a>
    ),

    name: (student: any) => (
        <a style={{ fontWeight: "bold" }} href={`/${student.id}`}>
            {student.name}
        </a>
    ),
};

const filters = [
    {
        type: "text",
        placeholder: "请输入用芳名",
        key: "name",
    },

    {
        type: "select",
        options: ["男", "女", "死变态", "二椅子"],
        placeholder: "请选择性别",
        key: "gender",
    },

    {
        type: "number",
        placeholder: "年龄",
        key: "age",
    },
];

export default function TableXXXDemo() {
    return (
        <div style={{ width: 1200 }}>
            <h3>TableXXXDemo</h3>
            <StoTableXXX
                data={allStudents}
                pageSize={10}
                sortableKeys={["id", "name", "age", "gender"]}
                formatter={formatter}
                currentPage={1}
                filters={filters}
            ></StoTableXXX>
        </div>
    )
}
